home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / winutils / wingauge.zip / WINGAUGE.DOC < prev    next >
Text File  |  1993-04-08  |  8KB  |  178 lines

  1. *************************************************************************
  2. *                                    *
  3. *              CrossSwords presents...            *
  4. *                                    *
  5. *------------------========================================-------------*
  6. *           WinMeter - Windows system features gauge        *
  7. *------------------========================================-------------*
  8. *                                    *
  9. *           Copyright (C) by CrossSwords, 1992, 1993        *
  10. *                                    *
  11. *            Author: Alexander A. Shultz            *
  12. *                                    *
  13. *************************************************************************
  14. *                                    *
  15. *    Environment:    Microsoft Windows 3.0                *
  16. *    Language:    Borland C                    *
  17. *    Tools:        Borland C++ 2.0                    *
  18. *                                    *
  19. *************************************************************************
  20.  
  21.                         To my wife and son with love.
  22.  
  23.  
  24.      One day I sat in a library looking through some  computer  journals.
  25. Suddenly one article named "Measure your machine's activity and learn how
  26. to  use  OS/2  threads  with  CPUMETER"  by Bob Chiverton (from Microsoft
  27. Systems Journal, vol.5 No.6, pp.49-60) was striking for me.  This is  its
  28. beginning:
  29.  
  30.      "It's a miracle my first sports car didn't explode.  It has only two
  31. speeds  --  legal  and illegal.  But I was 19, it was summer, and the car
  32. wasn't really mine.  I borrowed it from my friend, Roman.  And  if  Roman
  33. knew  I  pushed  the  tachometer into the redzone in every gear including
  34. reverse, you wouldn't be reading this now."
  35.  
  36.      "I don't redline tachometers anymore, now that I  pay  for  my  auto
  37. repairs,  but  I still enjoy speed -- especially in my computers.  That's
  38. why I wrote CPUMETER, an OS/2 Presentation  Manager  program  that  shows
  39. when I'm redlining the CPU."
  40.  
  41.      Yes, Bob, you are lucky.  Not only in car driving, but in programming
  42. too.  Well, but OS/2 is *really* multithread system.  And can  *I*  write
  43. anything  like  it  for  Microsoft Windows?  My programmer's honor was on
  44. stake, and I've started to program WinMeter.
  45.  
  46.      When WinMeter was ready, I've found that there are some more features
  47. to measure in Windows.  So WinMeter had to grow, and now it is WinGauge -
  48. a tool for measuring Windows features.
  49.  
  50.      Of course, Windows isn't OS/2, and WinGauge  isn't  a precise  tool,
  51. but not only a toy too. Moreover, if you will be glad to see how it works,
  52. or  if  my program can help you to write your own ones,  then I didn't in
  53. vain read Bob's article and "licked" my program.
  54.  
  55.      You can run WinGauge by three different ways:
  56.     1) You can type full path to WinGauge.exe in "File|Run..." dialog
  57.        box and press ENTER. No parameter is needed.
  58.     2) You can put this program (using "File|New..." menu command) to
  59.        one of your groups in Program Manager and then blast off it by
  60.        the mouse or the keyboard.
  61.     3) You can add full path  to  WinGauge.exe  to  "Load"  or  "Run"
  62.        sections of WIN.INI file to start WinMeter during boot process
  63.        of Windows.
  64.  
  65.      If there are too many clocks or timers in Windows now, WinGauge wait
  66. while you close some applications and free one Windows' timer for it.
  67.  
  68.      You can run up to three instances of WinGauge to see all its panels.
  69. If you try to run fourth instance of Wingauge, it shows a message box and
  70. hilites one of currently active WinGauge panel.
  71.  
  72.      WinGauge can run in two modes.
  73.  
  74.      First is  "Full-screen mode",  when you can  see  all  three  panels
  75. worked. This mode is start mode,  if you "run" (not "load") WinGauge.  In
  76. this mode WinGauge shows you: 1) WinMeter panel -- one that shows you the
  77. percentage of system overloading; 2) ResMeter panel -- one that shows you
  78. free system resources value, and  3) MemMeter panel -- one that shows you
  79. total amount of free memory. Moreover, you can see number of loaded tasks
  80. in Windows to the right of WinMeter panel.
  81.  
  82.      If screen space is you critical resource,  you can minimize WinGauge
  83. and see how it works in the second  mode  --  "Panel mode".  To  do  this
  84. simply push Minimize button of WinGauge window. BUT. If you do so, you'll
  85. see only 'integrated' icon of WinGauge -- the icon, not the working panel!
  86. So  you  must  choose  the panel  to demonstrate in Panel mode before you
  87. switch to it.
  88.  
  89.      There is two ways to choose active panel in WinGauge:  one  with the
  90. keyboard, another -- with the mouse.  With the keyboard you can use arrow
  91. keys, [Tab] and [Shift-Tab] to move hilite (border around the panel)  and
  92. press [Space] or [Enter]  to select hilited panel.  If there was selected
  93. panel, it is deselected. If you don't want to choose  any  panel,  select
  94. current active panel ones more -- it will be deselected.   With the mouse
  95. you can simply click left mouse button on panel icon.  To deselect active
  96. panel press button ones more.  With the mouse you can shorter the process
  97. of selecting and minimizing WinGauge. Make a double-click on  one  panel,
  98. and you'll select it and minimize simultaneously.
  99.  
  100.      Selected panel is draw like "deepen" button.
  101.  
  102.      The  "About Wingauge..."  dialog  box  (called  from  System menu of
  103. WinGauge window) is modified when one of  the  panels  is  selected.  The
  104. description of selected panel with its icon appear in addition to standard
  105. program and author information.
  106.  
  107.      Users of Windows 3.10 or greater can see one more item in the System
  108. menu. It is well-known "Always on Top" item to make your WinGauge panel(s)
  109. visible all time. To change top status of WinGauge select this menu item.
  110. Checkmark near it helps you to determine weather it is active.
  111.  
  112.      Of course, you can shut down WinGauge any time you  want  to do  it,
  113. but I hope you will never want to shut up WinGauge!
  114.  
  115.  
  116.                     Sincerely Yours
  117.                            Alexander A. Shultz.
  118.  
  119.  
  120.      WinGauge is FreeWare, so you are free to use or distribute  it  with
  121. only few restrictions:
  122.  
  123.     WinGauge must be distributed in absolutely unmodified form,
  124.     including program, documentation, and other files.
  125.  
  126.     WinGauge may not be included to any other product for any
  127.     reason whatsoever without a license from CrossSwords.
  128.  
  129.     No charge or payment may be levied or accepted for WinGauge.
  130.  
  131.  
  132.      If you want to use  WinGauge  or some of its code  in your products,
  133. please contact the author to get permission.
  134.  
  135.      If you find WinGauge funny or usable,  you can support me by sending
  136. some fee. Contact with author to know how to do it.
  137.  
  138.  
  139. To contact with author,
  140.  
  141.     phone:    +7-095-203-6690, LPS-Inter (weekdays)
  142.         +7-095-530-3822            (weekends)
  143.        E-mail:  FIDO 2:5020/40.17
  144.  
  145. Please use Russian or English in you messages.
  146.  
  147.  
  148.  
  149. P.S.  For men who like to make one's way through other's code.
  150.  
  151.      The code itself is very simple, but there are some tricks here. The
  152. 'trickiest' tricks are in WinMeter module code.
  153.  
  154.      The main idea of WinMeter is in  Windows'  timer  message  handling.
  155. This is a low-priority message in Windows.  So when your program (or task)
  156. has only WM_PAINT and WM_TIMER messages in queue, and there is  any  task
  157. that  have other messages in queue, Windows switches to it. Also, Windows
  158. don't accumulate non-proceeded WM_TIMER messages, but discards them  from
  159. program's  queue.  So the more WM_TIMER messages are gone, the more tasks
  160. are in system.  This is the main measure in WinMeter.
  161.  
  162.      Other  tricks  are  for  pretty  looking.  They are: cursor handling
  163. during  icon  dragging,  'About...'  dialog  box  background  color,  and
  164. preventing  from  icon  opening.  They all are standard, and you can find
  165. explanation in well-known book by Charles Petzold or in  inline  help  of
  166. Borland C++, or in Microsoft SDK 3.0 help system.
  167.  
  168.      For those who use Microsoft Windows 3.10  or greater,  I have  added
  169. "Always on Top"  option  in system menu of WinGauge. It is not trick, but
  170. the new technique, and I want to hilite this fact.
  171.  
  172.      Hoo, I've missed one interesting thing! Look into INTEGR1.C  file --
  173. there are no well-known Windows' loop here!  Things are very simple --  I
  174. use DialogBox as a main window, so I need not to use this loop.
  175.  
  176.      I hope that some comments I've added to program listing can help you
  177. to walk into my code. Good luck!
  178.